<?php

namespace App\Http\Controllers;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use GatewayClient\Gateway;

class TestController extends Controller
{
    //测试专用
    public function __construct()
    {
        //设置Gatewayworker服务的register服务与ip和端口
        Gateway::$registerAddress='127.0.0.1:8282';
    }

    public function test(Request $request)
    {
        $data = [
            'type' => 'type',
            'data' => [
                '用户信息1' => '用户信息1',
                '用户信息2' => '用户信息2',
                '用户信息3' => '用户信息3'
            ]
        ];
        Gateway::sendToAll(json_encode($data));
    }

}


